<!DOCTYPE html>

<html>

  <head>

    <meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script src="../../js/jquery.js"></script>

    <style type="text/css">

      html { height: 100% }

      body { height: 100%; margin: 0; padding: 0 }

      #map-canvas { height: 100% }

    </style>

    <script type="text/javascript"

      src="https://maps.googleapis.com/maps/api/js?v=3.exp&key=AIzaSyAUU7fxPxVpieI7lSHpw3uwp4ukmI8otqI&sensor=true">

    </script>

    <script type="text/javascript">



    var param=window.location.href.split("|");

       var zoomlevel=9;

    
 
function initialize() {
      
    
 var myLatLng = new google.maps.LatLng(18, 96);
  var mapOptions = {
    zoom: 6,
    center: myLatLng,
    mapTypeId: google.maps.MapTypeId.HYBRID
  };

  var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);


var image='NW.png';  


    var flightPlanCoordinates = [];

 $.getJSON( "http://code.whereismyanmar.net/map/",{"flight":localStorage.flightNumber,"reverse":localStorage.direction})
.done(function(data) {
	var logs=data.TrackLogResult.positions;
	for(var i=0;i<logs.length;i++)
	{
	  flightPlanCoordinates.push(new google.maps.LatLng(logs[i].latitude,logs[i].longitude)); 
	
	}
	
   var  flightPath = new google.maps.Polyline({
    path: flightPlanCoordinates,
    strokeColor: '#FF0000',
    strokeOpacity: 1.0,
    strokeWeight: 2
  });
   
    
       var   marker = new google.maps.Marker({
            position: flightPlanCoordinates[flightPlanCoordinates.length-1],
            map: map,
            title:"current position" ,
            icon:data.TrackLogResult.positions[flightPlanCoordinates.length-1].direction+".png"
        });
  
  	flightPath.setMap(map);	
map.setCenter(flightPlanCoordinates[flightPlanCoordinates.length-1]);

})
.fail(function( jqxhr, textStatus, error ) {
    alert(error);
});
  
  

      }

     

google.maps.event.addDomListener(window, 'load', initialize);


    </script>

  </head>

  <body>

    <div id="map-canvas" />

  </body>

</html>